<?php
/**
* WDC Like Dislike
* @author WDC <contact@web-designs-company.com>
* @link http://www.web-designs-company.com/
* @copyright (C) 2011 - 2012 JExtension
* @license GNU/GPL, see LICENSE.php for full license.
**/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

?>
<div class="componentheading">
	<?php echo JText::_( 'JEXTN_INTERMEDIATE' ); ?>
</div>
<table border="0" width="100%" >
<thead>
	<tr>
		<th width="5%" align="center">
			<?php echo JText::_( 'JEXTN_ID' ); ?>
		</th>
		<th align="center">

			<?php echo JText::_( 'JEXTN_CONT_TITLE' ); ?>
		</th>
		<th width="20%" align="center">
			<?php echo JText::_( 'JEXTN_LIKE' ); ?>
		</th>
		<th width="20%" align="center">
			<?php echo JText::_( 'JEXTN_DISLIKE' ); ?>
		</th>
		<th width="20%" align="center">
			<?php echo JText::_( 'JEXTN_MOST_LIKE' ); ?>
		</th>
		<th width="20%" align="center">
			<?php echo JText::_( 'JEXTN_MOST_DISLIKE' ); ?>
		</th>
	</tr>
</thead>
<?php
$k = 0;
for ($i=0, $n=count( $this->items ); $i < $n; $i++)
{
	$row = &$this->items[$i];

	$link 		= JRoute::_( 'index.php?option=com_content&view=article&id='. $row->id );

	?>
	<tr class="<?php echo "row$k"; ?>">
		<td align="center">
			<?php echo $row->id; ?>
		</td>
		<td align="center">
			<a href="<?php echo $link; ?>"><?php echo $row->title; ?></a>
		</td>
		<td align="center">
			<?php echo $this->items2; ?>
		</td>
		<td align="center">
			<?php echo $this->items1; ?>
		</td>
		<td align="center">

			<?php
		 	$img=JURI::root().'administrator/components/com_wdclikedislike/images/likes.PNG';
			if($this->items2>=5){
				echo "<img src='$img' />";
			}else{
				echo "None";
			} ?>
		</td>
			<td align="center">
			<?php
		 	$img=JURI::root().'administrator/components/com_wdclikedislike/images/dlikes.PNG';
			if($this->items1>=5){
				echo "<img src='$img' />";
			}else{
				echo "None";
			} ?>
		</td>
	</tr>
	<?php
	$k = 1 - $k;
}
?>
</table><br/>
<p class="copyright" align="center">
WDC Like and Dislike 1.0 - developed by <a href="http://www.joomla-web-developer.com" target="_blank">Joomla Web Developer</a>
</p>